# encoding: utf-8
# Datetime  : 2020/6/3 10:12 AM
# User      : zzz
# File      : file_util.py
import os


def get_project_path():
    file_path = os.path.split(os.path.abspath(__file__))[0]
    project_path = file_path.rstrip('/util')
    return project_path


def get_project_path_1():
    project_name = "discuss"
    cur_path = os.path.abspath(os.path.dirname(__file__))
    root_path = cur_path[:cur_path.find(project_name + "/") + len(project_name + "/")]  # 关键点！！
    return root_path


if __name__ == '__main__':
    get_project_path()
